

<div class="ads-form">
    <div class="list-group">
        <div class="list-group-item">
           
              
                   
                        <fieldset>
                                <legend><?php echo __('My Ads'); ?></legend>
                               
                                <label>Choose Category</label>
                                <select name="catlist" class="form-control" id="catlist" required> 
                                    <option value="">- Select Categories -</option>
                                    <?php foreach($cat_list as $list){
                                        ?><option value="<?php echo $list['Category']['id'];?>"><?php echo $list['Category']['name'];?></option>
                                    <?php    } ?>
                                </select>
                        </fieldset>
              
            
    </div>
    </div>
</div>

<script>
  var _ROOT = "<?php echo $this->Html->url('/', true); ?>";
  $(function() {
   
   $('#catlist').change(function() {
        var cat_id=$(this).val(); 

       window.location = _ROOT + 'products/add/'+cat_id;
    });
   
    });
    
    </script>